<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<%
	String path = request.getContextPath() + "/";
%>
<!DOCTYPE html>
<html>
<head>
<base href="<%=path%>" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>所有项目类型</title>
<link rel="stylesheet" href="admin/css/bootstrap.min.css" />
<link rel="stylesheet" href="admin/css/dashboard.css" />
<link rel="stylesheet" href="admin/css/dialog.css" />
</head>



<body>
	<!--上部导航栏start-->
	<nav class="navbar navbar-inverse navbar-fixed-top">
		<div class="container-fluid">
			<!-- 头 -->
			<%@include file="/WEB-INF/admin/import/header.jsp"%>
		</div>
	</nav>
	<!--上部导航栏end-->
	<div class="container-fluid">
		<div class="row">
			<!--左侧导航栏start-->
			<%@include file="/WEB-INF/admin/import/tisch.jsp"%>
			<!--左侧导航栏end-->
			<div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main">
				<h1 class="page-header">众筹项目分类</h1>

				<div class="panel panel-default"></div>
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title">
							项目分类列表 <a class="btn btn-primary" href="admin/toaddclassity">添加</a>
						</div>
					</div>
					<div class="panel-body">

						<div class="table-responsive ">
							<table class="table table-striped table-bordered">
								<thead>
									<tr>
										<th>序号</th>
										<th>分类名称</th>
										<th>分类描述</th>
										<th>添加时间</th>
										<th>分类状态</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<c:forEach items="${pageInfo.list }" var="type"
										varStatus="status">
										<tr>
											<td>${status.count }</td>
											<td>${type.name }</td>
											<td>${type.detail }</td>
											<td><fmt:formatDate value="${type.time }"
													pattern="yyyy-MM-dd" /></td>
											<c:choose>
												<c:when test="${type.status==1 }">
													<td>可用</td>
												</c:when>
												<c:when test="${type.status==0 }">
													<td>禁用</td>
												</c:when>
											</c:choose>
											<td><a href="admin/toupdateclassity?id=${type.id }"
												data-toggle="modal" data-target="#myModal" onclick="">修改</a>
												| <a href="admin/deleteclassity?id=${type.id }"
												onclick="return deteleClassity()">删除</a></td>
										</tr>
									</c:forEach>
								</tbody>
							</table>
						</div>
						<!--模态框-->
						<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
							aria-labelledby="myModalLabel" aria-hidden="true">
							<div class="modal-dialog">
								<div class="modal-content">
									<div class="modal-header">
										<button type="button" class="close" data-dismiss="modal"
											aria-hidden="true">&times;</button>
										<h4 class="modal-title" id="myModalLabel">分类详情</h4>
									</div>
									<div class="modal-body">
										<div class="form">
											<form class="form-validate form-horizontal"
												id="feedback_form" method="post">
												<div class="form-group ">
													<label for="p_id" class="control-label col-lg-2">序号<span
														class="required"> *</span></label>
													<div class="col-lg-10">
														<input class="form-control" id="p_id" type="text" readonly />
													</div>
												</div>

												<div class="form-group ">
													<label for="p_name" class="control-label col-lg-2">分类名称<span
														class="required"> *</span></label>
													<div class="col-lg-10">
														<input class="form-control" id="p_name" type="text" />
													</div>
												</div>
												<div class="form-group ">
													<label for="p_des" class="control-label col-lg-2">分类描述<span
														class="required"> *</span></label>
													<div class="col-lg-10">
														<input class="form-control" id="p_des" type="text" />
													</div>
												</div>
												<div class="form-group ">
													<label for="p_time" class="control-label col-lg-2">添加时间<span
														class="required"> *</span></label>
													<div class="col-lg-10">
														<input class="form-control" id="p_time" type="text"
															readonly />
													</div>
												</div>

												<div class="form-group ">
													<label for="p_status" class="control-label col-lg-2">分类状态<span
														class="required"> *</span></label>
													<div class="col-lg-10">
														<select class="form-control m-bot15" id="p_status">
															<option>可用</option>
															<option>禁用</option>
														</select>
													</div>
												</div>
												<div class="form-group" style="text-align: right;">
													<div class="col-lg-offset-2 col-lg-10">
														<button class="btn btn-primary" type="button" onclick="">保存</button>
														<button class="btn btn-default" type="reset">重置</button>
													</div>
												</div>
											</form>
										</div>
									</div>
								</div>
							</div>
						</div>
						<nav aria-label="Page navigation" class="text-right">
							<ul class="pagination">
								<li><a href="admin/classity?page=${pageInfo.prePage }"
									aria-label="Next">上一页 <span aria-hidden="true">&laquo;</span>
								</a></li>
								<li class="active"><a href="#">${pageInfo.pageNum }/${pageInfo.pages }</a></li>
								<li><a href="admin/classity?page=${pageInfo.nextPage }"
									aria-label="Next">下一页 <span aria-hidden="true">&raquo;</span>
								</a></li>
							</ul>
						</nav>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
	<script type="text/javascript" src="admin/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="admin/js/countUp.js"></script>
	<script type="text/javascript" src="admin/js/dialog.js"></script>
	<script>
		function getTable(p_id, p_name, p_des, p_time, p_status) {
			document.getElementById("p_id").value = p_id;
			document.getElementById("p_name").value = p_name;
			document.getElementById("p_des").value = p_des;
			document.getElementById("p_time").value = p_time;
			document.getElementById("p_status").value = p_status;
		}
	</script>

	<script type="text/javascript">
		function deteleClassity() {
			if (confirm("确定要删除吗")) {
				return true;
			} else {
				return false;
			}
		}
	</script>

</body>
</html>